<%-- 
 *Workshop 
 *Class ID        : SE0691   
 *Student ID      : SE90009
 *Student Name    : Phạm Nguyễn Nhật Trung
 *Due Date        : Nov 22, 2012, 3:13:54 AM
 *I declare that this assignment is my own work
 *in accordance with FPT Policy.
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="Trackertag" uri="/WEB-INF/tlds/TrackerTag_library" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <LINK REL=StyleSheet HREF="../style/style.css" TYPE="text/css" MEDIA=screen>
        <title>Torrents Page</title>
    </head>
    <body>
        <%
            Boolean isLogin = false;
            Cookie[] ck = request.getCookies();
            try {
                if (ck != null) {
                    for (int i = 0; i < ck.length; i++) {
                        if ("userId".equals(ck[i].getName())) { //Finding Username Cookie                
                            i = ck.length;
                            isLogin = true;
                        }
                    }

                }
            } catch (Exception e) {
            }
            if (isLogin == false) {
                response.sendRedirect("login.jsp");
                return;
            }
        %>
        <jsp:include page="navigation.jsp" />
        <div id="torrent-list-form">
            <div style="padding-left: 10px;"><h2>Torrent List</h2></div>

            <ul id="holder">
                <Trackertag:ListTorrentsTagHandler/>
            </ul> 
        </div>
        <script type="text/javascript" src="../scripts/jquery.js"></script>
        <script type="text/javascript" src="../scripts/pagination.js"></script>
    </body>
</html>
